package com.ws.ssmzongjie3.mapper;

import com.ws.ssmzongjie3.bean.Orders;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrdersMapper {
    @Delete("DELETE FROM orders WHERE order_id=#{order_id}")
    int deleteOrderById(Orders orders);
    @Insert("INSERT INTO orders(order_id,route_id,user_id,orders_state,orders_price,buy_date,adult,child) VALUES(#{order_id},#{route_id},#{user_id},#{orders_state},#{orders_price},#{buy_date},#{adult},#{child})")
    int insertOrder(Orders orders);
    @Select("SELECT * FROM orders WHERE order_id=#{order_id}")
    Orders getOrderById(Orders orders);
    int updateOrderById(Orders orders);
    List<Orders> listOrderByUserId(Orders orders);
    List<Orders> listOrderWithRouteAndUser(Orders orders);

}
